package com.jn.rxjava.entity;

import android.os.Parcel;
import android.os.Parcelable;

import androidx.annotation.NonNull;

import java.util.List;

public class BingResponse {
    private int code;
    private String msg;
    private List<BingImage> result;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public List<BingImage> getResult() {
        return result;
    }

    public void setResult(List<BingImage> result) {
        this.result = result;
    }

    public class BingImage implements Parcelable {
        private String title;
        private String url;

        public BingImage(String title, String url) {
            this.title = title;
            this.url = url;
        }

        protected BingImage(Parcel in) {
            title = in.readString();
            url = in.readString();
        }

        public final Creator<BingImage> CREATOR = new Creator<BingImage>() {
            @Override
            public BingImage createFromParcel(Parcel in) {
                return new BingImage(in);
            }

            @Override
            public BingImage[] newArray(int size) {
                return new BingImage[size];
            }
        };

        public String getTitle() {
            return title;
        }

        public String getUrl() {
            return url;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(@NonNull Parcel dest, int flags) {
            dest.writeString(title);
            dest.writeString(url);
        }

}}
